﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Configuration;
using OF.Utility;

namespace OF.Component.Base
{
    public class AppSettings
    {
        /// <summary>
        /// 获取完整图片地址
        /// </summary>
        /// <param name="relativePath"></param>
        /// <returns></returns>
        public static string GetHttpFilePath(string relativePath)
        {
            return UploadFileHttpHost + relativePath;
        }
        /// <summary>
        /// 微信小程序AppID
        /// </summary>
        public static string WxAppID
        {
            get { return ConfigHelper.GetValue("WxAppId"); }
        }
        /// <summary>
        /// 微信小程序App密钥
        /// </summary>
        public static string WxAppSecret
        {
            get { return ConfigHelper.GetValue("WxAppSecret"); }
        }
        /// <summary>
        /// 微信支付商户号
        /// </summary>
        public static string WxMchId
        {
            get { return ConfigHelper.GetValue("WxMchId"); }
        }
        /// <summary>
        /// 上传文件目录
        /// </summary>
        public static string UploadFileDir
        {
            get { return ConfigHelper.GetValue("UploadFileDir"); }
        }
        /// <summary>
        /// 上传文件http访问域名
        /// </summary>
        public static string UploadFileHttpHost
        {
            get { return ConfigHelper.GetValue("UploadFileHttpHost"); }
        }
        /// <summary>
        /// 文件http访问完整基地址
        /// </summary>
        public static string UploadFileFullHttpDir
        {
            get { return ConfigHelper.GetValue("UploadFileFullHttpDir"); }
        }
        /// <summary>
        /// 文件http访问相对目录基地址
        /// </summary>
        public static string UploadFileRelativeHttpDir
        {
            get { return ConfigHelper.GetValue("UploadFileRelativeHttpDir"); }
        }
        /// <summary>
        /// 短信发送接口
        /// </summary>
        public static string ShortMessageUrl
        {
            get { return ConfigHelper.GetValue("ShortMessageUrl"); }
        }
        /// <summary>
        /// 短信接口平台Id
        /// </summary>
        public static int ShortMessagePlatformId
        {
            get { return EConvert.ToInt(ConfigHelper.GetValue("ShortMessagePlatformId")); }
        }
        
    }
}
